package com.wdg.controller;

import com.wdg.pojo.Cookbook;
import com.wdg.pojo.Topic;
import com.wdg.pojo.User;
import com.wdg.service.IUserCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/UserCenterController")
public class UserCenterController {

    @Autowired
    private IUserCenterService userCenterService;

    @GetMapping("/getCookBookByUid")
    public List<Cookbook> getCookBookByUid(@RequestParam("uid") int uid){

        return userCenterService.getCookBookByUid(uid);
    }

    @GetMapping("/getTopicByUid")
    public List<Topic> getTopicByUid(@RequestParam("uid") int uid){

        return userCenterService.getTopicByUid(0,uid);
    }

    //获得我的关注
    @GetMapping("/getMyFocus")
    public List<User> getMyFocus(@RequestParam String uid){
        return userCenterService.getMyFocus(uid);
    }
    //获得我的收藏
    @GetMapping("/getMyStatoff")
    public List<Cookbook> getMyStatoff(@RequestParam String uid){
        return userCenterService.getMyStatoff(uid);
    }

}
